var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {
    value: !0
}),
o.SceneManager = o.SceneName = void 0;
var i, n = t("Util"),
a = t("AssetsManager"); (function(t) {
    t[t.none = 0] = "none",
    t[t.hall = 1] = "hall",
    t[t.gamePK = 2] = "gamePK"
})(i = o.SceneName || (o.SceneName = {}));
var r = function() {
    function t() {
        this.scene = i.none,
        this.node_loading = null
    }
    return Object.defineProperty(t, "Instance", {
        get: function() {
            return null == this.instance && (this.instance = new t),
            this.instance
        },
        enumerable: !1,
        configurable: !0
    }),
    t.prototype.runScene = function(t, e) {
        var o = this;
        if (t != this.SceneName) {
            this.isLoaded = !1,
            n.Util.getAssets(n.Util.getBundle(a.BundleName.Hall), a.assets.loadingPanel).then(function(t) {
                o.isLoaded || (o.node_loading = cc.instantiate(t), cc.find("Canvas").addChild(o.node_loading))
            });
            var r = t == i.hall ? a.BundleName.Hall: a.BundleName.Game;
            n.Util.getBundle(r).loadScene(i[t],
            function(i, n) {
                o.isLoaded = !0,
                o.node_loading && (o.node_loading.destroy(), o.node_loading = null),
                e && e(),
                o.scene = t,
                cc.director.runScene(n)
            })
        }
    },
    Object.defineProperty(t.prototype, "SceneName", {
        get: function() {
            return this.scene
        },
        enumerable: !1,
        configurable: !0
    }),
    t.instance = null,
    t
} ();
o.SceneManager = r